package com.pmh.hrs.sys.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.pmh.hrs.sys.dao.SysMenuCodeDAO;
import com.pmh.hrs.sys.service.SysMenuCodeService;
import com.pmh.hrs.sys.vo.SysMenuCodeVO;

@Service("sysMenuCodeService")
public class SysMenuCodeServiceImpl implements SysMenuCodeService{

	@Resource(name="sysMenuCodeDAO")
	private SysMenuCodeDAO sysMenuCodeDAO;
	
	
	private SysMenuCodeVO convertSysMenuCodeVO(Map<String,Object> paramMap) throws Exception{
		SysMenuCodeVO sysMenuCodeVO = new SysMenuCodeVO();
		BeanUtils.copyProperties(paramMap, sysMenuCodeVO);
		return sysMenuCodeVO;
	}
	
	@Override
	public int insert(Map<String,Object> paramMap) throws Exception {
		SysMenuCodeVO sysMenuCodeVO =  this.convertSysMenuCodeVO(paramMap);
		return sysMenuCodeDAO.insert(sysMenuCodeVO);
	}

	@Override
	public int update(Map<String,Object> paramMap) throws Exception {
		SysMenuCodeVO sysMenuCodeVO =  this.convertSysMenuCodeVO(paramMap);
		return sysMenuCodeDAO.update(sysMenuCodeVO);
	}

	@Override
	public int delete(Map<String,Object> paramMap) throws Exception {
		return sysMenuCodeDAO.delete(paramMap);
	}

	@Override
	public List<Map<String, Object>> selectList(Map<String,Object> paramMap) throws Exception {
		return sysMenuCodeDAO.selectList(paramMap);
	}

}
